<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Controller for managing dashboard.
 * @package cms-dashboard/conrollers
 * @category Controller
 * 
 * @author Mark Angelo Angulo
 * @copyright (c) 2014
 */
class Dashboard extends CMS_Controller {

    /**
     *  Constructor method.
     */
    function __construct()
    {
        parent::__construct();
//        $this->load->helper('mysql_parser');
        $this->load->helper('mysql_to_migration');
    }

    /**
     * Default method called when nothing is specified.
     * Displays dashboard.
     * @access public
     */
    public function index()
    {
//        $this->load->library('migration');
//        if (!$this->migration->current())
//        {
//            show_error($this->migration->error_string());
//        }
//        exit;
        
//        $x = mysql_to_array( FCPATH . 'db_bootstrap24Jun2014.sql' );
//        echo '<pre>';
//        print_r($x); 
//        echo '</pre>';
//        exit();
        
        // active navigation
        $data['navigation'] = 'dashboard';

        // build breadcrumb
        $this->breadcrumb->clear();
        $this->breadcrumb->add_crumb('Dashboard');

        // build template
        $this->template
                ->title('Dashboard')
                ->set_layout('main')
                ->set_partial('navigation', 'layouts/navigation')
                ->set_partial('footer', 'layouts/footer')
                ->build('dashboard', $data);
        
    }
    
    public function sidebar()
    {
        // active navigation
        $data['navigation'] = 'dashboard';

        // build breadcrumb
        $this->breadcrumb->clear();
        $this->breadcrumb->add_crumb('Dashboard');

        // build template
        $this->template
                ->title('Dashboard')
                ->set_layout('main')
                ->set_partial('navigation', 'layouts/navigation')
                ->set_partial('footer', 'layouts/footer')
                ->build('sidebar', $data);
    }

}

/* End of file dashboard.php */
/* Location: ./application/modules/cms-dashboard/controllers/dashboard.php */